{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% set modalSize = 'large' %}

{% block title %}添加新用户{% endblock %}
{% block body %}
<!--    滑块-->
<script src="{{ asset('assets/libs/jquery.min.js') }}"></script>
<script src="{{ asset('assets/libs/jquery-ui.min.js') }}"></script>
    <link href="{{ asset('bundles/topxiaweb/css/jquery-ui.min.css') }}" rel="stylesheet"/>
<form id="user-create-form" class="form-horizontal" method="post" action="{{ path('admin_user_create')}}">

  <div class="row form-group">
    <div class="col-md-2 control-label">
      <label for="email">邮箱地址</label>
    </div>
    <div class="col-md-7 controls">
      <input type="text" id="email" data-url="{{path('admin_user_create_email_check')}}" name="email" class="form-control" >
    </div>
  </div>

  <div class="row form-group">
    <div class="col-md-2 control-label">
      <label for="nickname">用户名</label>
    </div>
    <div class="col-md-7 controls">
      <input type="text" id="nickname" name="nickname" data-url="{{path('admin_user_create_nickname_check')}}" class="form-control" >
    </div>
  </div>

   <div class="row form-group">
    <div class="col-md-2 control-label">
      <label for="password">密码</label>
    </div>
      <div class="col-md-7 controls">
        <input type="password" id="password" name="password" class="form-control">
      <p class="help-block">5-20位英文、数字、符号，区分大小写</p>
    </div>
  </div>

    <div class="row form-group">
      <div class="col-md-2 control-label">
      <label for="confirmPassword">确认密码</label>
    </div>
      <div class="col-md-7 controls">
        <input type="password" id="confirmPassword" name="confirmPassword" class="form-control">
        <p class="help-block">再输入一次密码</p>
      </div>
    </div>

<div class="row form-group">
    <div class="col-md-2 control-label">
      <label for="roles">用户权限</label>
    </div>
    <div class="col-md-7 controls">
      <input type="checkbox" value="ROLE_TEACHER" name="roles[]"> 教师 
	  <input type="checkbox" value="ROLE_ORG" name="roles[]"> 机构
        <input type="checkbox" value="ROLE_AGENT" name="roles[]"> 代理商
    </div>
  </div>
<!--
<div class="row form-group">
    <div class="col-md-2 control-label">
      <label for="roles">用户等级</label>
    </div>
    <div class="col-md-7 controls">
      <p>
  <label for="amount">当前会员等级：</label>
  <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">
    <input type="hidden" name="level" value="9" id="level"/>      
</p>
<div id="slider-range-max"></div>
    </div>
  </div>
-->
  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

</form>
{% endblock %}

{% block footer %}
  <button id="user-create-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary pull-right" data-toggle="form-submit" data-target="#user-create-form">提交</button>
  <button type="button" class="btn btn-link pull-right" data-dismiss="modal">取消</button>
  <script>app.load('user/create-modal')</script>
<!--
 <script>
  $(function() {
    $( "#slider-range-max" ).slider({
      range: "max",
      min: 0,
      max: 7,
	  
      value: 0,
      slide: function( event, ui ) {
        
		if(ui.value=='1'){
			var level='高级会员';
			$( "#amount" ).val(level);	
            $( "#level" ).val( '1' );
		}else if(ui.value=='2'){
			var level='铜牌会员';
			$( "#amount" ).val(level);
            $( "#level" ).val( '2' );
		}else if(ui.value=='3'){
			var level='银牌会员';
			$( "#amount" ).val(level);
            $( "#level" ).val( '3' );
		}else if(ui.value=='4'){
			var level='金牌会员';	
			$( "#amount" ).val(level);
            $( "#level" ).val( '4' );
		}else if(ui.value=='5'){
			var level='白金会员';
			$( "#amount" ).val(level);
            $( "#level" ).val( '5' );
		}else if(ui.value=='6'){
			var level='黄金会员';
			$( "#amount" ).val(level);
            $( "#level" ).val( "6" );
		}else if(ui.value=='7'){
			var level='终极会员';	
			$( "#amount" ).val(level);
            $( "#level" ).val( "7" );
		}else if(ui.value=='0'){
			var level='普通会员';
			$( "#amount" ).val(level);
            $( "#level" ).val( '9' );
		}
      }
    });
    $( "#amount" ).val("普通会员");
  });
  </script>
-->
{% endblock %}